package org.vectrics.common.view;

/**
 * @author Mike Moore
 * @version 1.0
 */

import org.apache.ecs.html.IMG;
import org.apache.ecs.html.A;
import org.vectrics.common.html.*;

public class StandardMenuPage extends SimpleMenuPage {

	private static final long serialVersionUID = -6853523034218622901L;
	
	private Cell menuCell = null;
    private org.vectrics.common.html.Cell rightBannerCell = null;

    public StandardMenuPage() {
        super();
    }

    // Overrides StandardPage
    protected Row makeMenuRow() {
        Row menuRow = new Row();
        menuCell = menuRow.addCell();
        return(menuRow);
    }

    protected Cell getImage1Cell() {
        Cell cell1_1 = new Cell();
        cell1_1.setWidth("0%");
        cell1_1.addElement("<br>");

        //Add image to top left cell
        A imageLink = new A();
        imageLink.setHref("/site/main");
        imageLink.addElement(getBannerImage1());

        cell1_1.addElement(imageLink);
        cell1_1.setVAlign("bottom");
        return(cell1_1);
    }


    protected IMG getBannerImage1() {

        IMG img = new IMG();
        img.setAlt("Vectrics Inc.");
        img.setSrc(getGraphicsDirectory() + "/ag_2_1.gif");
        img.setBorder(0);

        return(img);
    }


    protected void fillBannerCell(Cell bannerCell) {
        Table table = new Table();
        bannerCell.addElement(table);
        table.setWidth("100%");
        table.setBorder(0);
        table.setCellPadding(0);
        table.setCellSpacing(0);

        Row row1 = table.addRow();

        Cell cell1_1 = getImage1Cell();
        row1.addElement(cell1_1);

        setRightBannerCell(row1.addCell());
    }


    public Cell getMenuCell() {
        return(menuCell);
    }


    public org.vectrics.common.html.Cell getRightBannerCell() {
        return rightBannerCell;
    }

    public void setRightBannerCell(org.vectrics.common.html.Cell cell) {
        rightBannerCell = cell;
    }
}
